﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using Navigant.Common;
using System;

namespace Navigant.DataContracts
{
    [DataContract(Name = "CaseChildItemContract", Namespace = ServiceConstants.DataContractNamespace)]
    public abstract class CaseChildItemContract : ContractBase
    {
        #region Fields

        private CaseContract parentCase;
        private Dictionary<string, string> extendedProperties;

        #endregion

        #region Constructors

        protected CaseChildItemContract()
        {
            this.parentCase = null;
            this.extendedProperties = new Dictionary<string, string>();
        }

        #endregion

        #region Properties

        [DataMember]
        public Dictionary<string, string> ExtendedProperties
        {
            get { return this.extendedProperties; }
            set 
            {
                if (!object.ReferenceEquals(this.extendedProperties, value))
                {
                    this.extendedProperties = value;
                    this.RaisePropertyChanged("ExtendedProperties");
                }
            }
        }

        [DataMember]
        public CaseContract ParentCase
        {
            get { return this.parentCase; }
            set 
            {
                if (!object.ReferenceEquals(this.parentCase, value))
                {
                    this.parentCase = value;
                    this.RaisePropertyChanged("ParentCase");
                }
            }
        }

        #endregion
    }
}
